var cph = '',openid='';
$(function(){
	openid = $('#openid').val();
	if(openid!=null&&openid!=''){
		localStorage.setItem("openid",openid);
	}else{
		openid = localStorage.getItem("openid");
	}
	if(openid==''||openid==null){
		// location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3a8350d9178db579&redirect_uri='+host_name+'/park/redirect2&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect';
		layer.open({
			content:'请重新扫码进入'
			,skin: 'msg'
			,time: 2 //2秒后自动关闭
		});
	}
	$.ajax({
		url: '/park/data/getUserInfo?openid='+openid+'&type=1',
		type: 'post',
		dataType: 'json',
		success: function(res) {
			if(res.data!=null){
				cph = res.data.cph;
				var arr = cph.split('');
				for(var i in arr){
					var x = parseInt(i)+1;
					$('#p'+x).html(arr[i]);
				}
			}
		}
	})
})
function backUp(){
	$('#main').show();
	$('#fuck').hide();
}
var orderNo = '';
var parkTimes = 0;
function select() {
	var cph = $('#p1').text()+$('#p2').text()+$('#p3').text()+$('#p4').text()+$('#p5').text()+$('#p6').text()+$('#p7').text();
	var p8=$('#p8').html();
	if(p8.indexOf('绿牌')>-1){
		
	}else{
		cph+=p8;
	}
	layer.open({
	    content:'查询中，请稍后...'
	    ,skin: 'msg'
	    ,time: 2 //2秒后自动关闭
	  });
	$.ajax({
		url : '/park/data/getByInfo',
		data : 'carLicense=' + cph+'&openid='+openid+'&type=1',
		type : 'post',
		dataType : 'json',
		success : function(res) {
			if(res.data.status==0){
				location.href = '/park/byxq';
			}else{
			 layer.open({
			    content:'您未开通包月服务'
			    ,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
			  });
			}
		}
	})
}